home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1993 July / InfoMagic USENET CD-ROM July 1993.ISO / sources / x / volume13 / font-browser / part01 next >
Encoding:
Internet Message Format  |  1991-07-05  |  27.0 KB

  1. Path: uunet!olivea!oliveb!veritas!amdcad!sun!exodus!opal.cs.tu-berlin.de
  2. From: phade@opal.cs.tu-berlin.de (Frank Gadegast)
  3. Newsgroups: comp.sources.x
  4. Subject: v13i076: X Font Browser, Part01/02
  5. Message-ID: <csx-13i076-font-browser@uunet.UU.NET>
  6. Date: 6 Jul 91 07:12:41 GMT
  7. Sender: news@exodus.Eng.Sun.COM
  8. Lines: 972
  9. Approved: argv@sun.com
  10.  
  11. Submitted-by: phade@opal.cs.tu-berlin.de (Frank Gadegast)
  12. Posting-number: Volume 13, Issue 76
  13. Archive-name: font-browser/part01
  14.  
  15.  
  16. So, this is now the X11-font-browser, latest edition.
  17. (With Imakefile and in shar-format. Thanks for the Imake-help to Dan Heller).
  18.  
  19. ------------------------------cut here-------------------------------
  20. #!/bin/sh
  21. # This is a shell archive (produced by shar 3.49)
  22. # To extract the files from this archive, save it to a file, remove
  23. # everything above the "!/bin/sh" line above, and type "sh file_name".
  24. #
  25. # made 07/01/1991 09:35 UTC by phade@trick
  26. # Source directory /tmp_mnt/home/all/phade/SRC/Phade/xfb
  27. #
  28. # existing files will NOT be overwritten unless -c is specified
  29. #
  30. # This shar contains:
  31. # length  mode       name
  32. # ------ ---------- ------------------------------------------
  33. #   2015 -rw-r--r-- README
  34. #  10759 -rw-r--r-- Makefile
  35. #   1120 -rw-r--r-- Makefile.mk
  36. #    679 -rw------- Imakefile
  37. #    151 -rw-r--r-- XFBROWS.AD
  38. #   1371 -rw-r--r-- bitmaps.h
  39. #   4110 -rw-r--r-- xfbrows.h
  40. #   2132 -rw-r--r-- xfbrows.man
  41. #
  42. # ============= README ==============
  43. if test -f 'README' -a X"$1" != X"-c"; then
  44.     echo 'x - skipping README (File already exists)'
  45. else
  46. echo 'x - extracting README (Text)'
  47. sed 's/^X//' << 'SHAR_EOF' > 'README' &&
  48. X
  49. X                            XFBROWS
  50. X                    =====================
  51. X
  52. This is a very nice font-browser under X11.
  53. Why should we still use xlsfont and xfd ?
  54. X
  55. It should work under nearly every system, 'cause it's programed without
  56. MOTIF, the X11-Toolit or other stupid things (like widgets, that you only
  57. can find somewhere in CHINA and that only run under Release 2. That happened
  58. once to me !!!), that are always causing problems. It only needs the
  59. XX11-library, no matter if you're using Release 3 or Release 4.
  60. X
  61. In addition it has some defines to let it run under BSD, SYSV, A/UX
  62. or XENIX and you don't have to hack a difficult Imake- or Make-file (I
  63. will never understand why people add horible Imake- or Make-files, if
  64. they only have to compile a few files and link them then together). And
  65. you will not have trouble with crazy pathnames !!!
  66. X
  67. X
  68. Compilation:
  69. ============
  70. X
  71. Select the right defines for your system and edit the Makefile.
  72. Select
  73. X
  74. X    -Di386        ,    if running on a Intel 386
  75. X    -DSVR4        ,    if you running a System-V-Unix
  76. X    -DSCO        ,    if you running a SCO-Xenix-Unix
  77. X
  78. X    -DNOTIMER    ,    if you have problems with timers
  79. X    -DUSLEPP    ,    if you have of a uslepp-call
  80. X
  81. If you're running a INTERACTIVE-Unix be shure you link with the inet-library.
  82. X
  83. Have a look into the Makefile to see what's right and then just enter
  84. X
  85. X    make
  86. X
  87. X
  88. Installation:
  89. =============
  90. X
  91. Just copy the resulting file XFBROWS whereever you like too.
  92. Make the man-page by typing
  93. X
  94. X    nroff -man xfbrows.man > xfbrows.1
  95. X
  96. and copy it whereever you will need it.
  97. X
  98. X
  99. Comments:
  100. =========
  101. X
  102. If you get problems (not really possible) to compile it or if you have
  103. comments send them to
  104. X
  105. X    phade@cs.tu-berlin.de
  106. X
  107. This tool is specialy made to include it in other utilities (I hate it,
  108. if you have to specify fontnames by typing them in, that should not
  109. happen in X11-applications), so if you do it, please send you're programs
  110. to me. Thank's a lot !!!
  111. X
  112. The source-code is edited with Tab-Space 4. If you like to hack around in
  113. the source-code, do so. I don't care, if you get problems.
  114. X
  115. X        Have fun    :-)
  116. X
  117. SHAR_EOF
  118. chmod 0644 README ||
  119. echo 'restore of README failed'
  120. Wc_c="`wc -c < 'README'`"
  121. test 2015 -eq "$Wc_c" ||
  122.     echo 'README: original size 2015, current size' "$Wc_c"
  123. fi
  124. # ============= Makefile ==============
  125. if test -f 'Makefile' -a X"$1" != X"-c"; then
  126.     echo 'x - skipping Makefile (File already exists)'
  127. else
  128. echo 'x - extracting Makefile (Text)'
  129. sed 's/^X//' << 'SHAR_EOF' > 'Makefile' &&
  130. # Makefile generated by imake - do not edit!
  131. # $XConsortium: imake.c,v 1.51 89/12/12 12:37:30 jim Exp $
  132. #
  133. # The cpp used on this machine replaces all newlines and multiple tabs and
  134. # spaces in a macro expansion with a single space.  Imake tries to compensate
  135. # for this, but is not always successful.
  136. #
  137. X
  138. ###########################################################################
  139. # Makefile generated from "Imake.tmpl" and </tmp/IIf.a02039>
  140. # $XConsortium: Imake.tmpl,v 1.77 89/12/18 17:01:37 jim Exp $
  141. #
  142. # Platform-specific parameters may be set in the appropriate .cf
  143. # configuration files.  Site-wide parameters may be set in the file
  144. # site.def.  Full rebuilds are recommended if any parameters are changed.
  145. #
  146. # If your C preprocessor doesn't define any unique symbols, you'll need
  147. # to set BOOTSTRAPCFLAGS when rebuilding imake (usually when doing
  148. # "make Makefile", "make Makefiles", or "make World").
  149. #
  150. # If you absolutely can't get imake to work, you'll need to set the
  151. # variables at the top of each Makefile as well as the dependencies at the
  152. # bottom (makedepend will do this automatically).
  153. #
  154. X
  155. ###########################################################################
  156. # platform-specific configuration parameters - edit sun.cf to change
  157. X
  158. SYSLIBS=-lXt -lX11
  159. MWM_DEFINES=-DSHAPE -DOPAQUE
  160. X
  161. # platform:  $XConsortium: sun.cf,v 1.38 89/12/23 16:10:10 jim Exp $
  162. # operating system:  SunOS 4.0.3
  163. X
  164. ###########################################################################
  165. # site-specific configuration parameters - edit site.def to change
  166. X
  167. # site:  $XConsortium: site.def,v 1.21 89/12/06 11:46:50 jim Exp $
  168. X
  169. X            SHELL = /bin/sh
  170. X
  171. X              TOP = /home/X11R4/mit
  172. X      CURRENT_DIR = /home/all/phade/SRC/Phade/xfb
  173. X
  174. X               AR = ar cq
  175. X  BOOTSTRAPCFLAGS =
  176. X               CC = cc
  177. X
  178. X         COMPRESS = compress
  179. X              CPP = /lib/cpp $(STD_CPP_DEFINES)
  180. X    PREPROCESSCMD = cc -E $(STD_CPP_DEFINES)
  181. X          INSTALL = install
  182. X               LD = ld
  183. X             LINT = lint
  184. X      LINTLIBFLAG = -C
  185. X         LINTOPTS = -axz
  186. X               LN = ln -s
  187. X             MAKE = make
  188. X               MV = mv
  189. X               CP = cp
  190. X           RANLIB = ranlib
  191. X  RANLIBINSTFLAGS =
  192. X               RM = rm -f
  193. X     STD_INCLUDES =
  194. X  STD_CPP_DEFINES =
  195. X      STD_DEFINES =
  196. X EXTRA_LOAD_FLAGS =
  197. X  EXTRA_LIBRARIES =
  198. X             TAGS = ctags
  199. X
  200. X    SHAREDCODEDEF = -DSHAREDCODE
  201. X         SHLIBDEF = -DSUNSHLIB
  202. X
  203. X    PROTO_DEFINES =
  204. X
  205. X     INSTPGMFLAGS =
  206. X
  207. X     INSTBINFLAGS = -m 0755
  208. X     INSTUIDFLAGS = -m 4755
  209. X     INSTLIBFLAGS = -m 0664
  210. X     INSTINCFLAGS = -m 0444
  211. X     INSTMANFLAGS = -m 0444
  212. X     INSTDATFLAGS = -m 0444
  213. X    INSTKMEMFLAGS = -m 4755
  214. X
  215. X          DESTDIR =
  216. X
  217. X     TOP_INCLUDES = -I$(TOP)
  218. X
  219. X      CDEBUGFLAGS = -O
  220. X        CCOPTIONS = -D_NO_PROTO -DSTRINGS_ALIGNED -DNO_REGEX -DNO_ISDIR -DUSE_RE_COMP -DUSE_GETWD
  221. X      COMPATFLAGS =
  222. X
  223. X      ALLINCLUDES = $(STD_INCLUDES) $(TOP_INCLUDES) $(INCLUDES) $(EXTRA_INCLUDES)
  224. X       ALLDEFINES = $(ALLINCLUDES) $(STD_DEFINES) $(PROTO_DEFINES) $(DEFINES) $(COMPATFLAGS)
  225. X           CFLAGS = $(CDEBUGFLAGS) $(CCOPTIONS) $(ALLDEFINES)
  226. X        LINTFLAGS = $(LINTOPTS) -DLINT $(ALLDEFINES)
  227. X           LDLIBS = $(SYS_LIBRARIES) $(EXTRA_LIBRARIES)
  228. X        LDOPTIONS = $(CDEBUGFLAGS) $(CCOPTIONS)
  229. X   LDCOMBINEFLAGS = -X -r
  230. X
  231. X        MACROFILE = sun.cf
  232. X           RM_CMD = $(RM) *.CKP *.ln *.BAK *.bak *.o core errs ,* *~ *.a .emacs_* tags TAGS make.log MakeOut
  233. X
  234. X    IMAKE_DEFINES =
  235. X
  236. X         IRULESRC = $(CONFIGSRC)
  237. X        IMAKE_CMD = $(NEWTOP)$(IMAKE) -I$(NEWTOP)$(IRULESRC) $(IMAKE_DEFINES)
  238. X
  239. X     ICONFIGFILES = $(IRULESRC)/Imake.tmpl $(IRULESRC)/Imake.rules \
  240. X            $(IRULESRC)/Project.tmpl $(IRULESRC)/site.def \
  241. X            $(IRULESRC)/$(MACROFILE) $(EXTRA_ICONFIGFILES)
  242. X
  243. ###########################################################################
  244. # X Window System Build Parameters
  245. # $XConsortium: Project.tmpl,v 1.63 89/12/18 16:46:44 jim Exp $
  246. X
  247. ###########################################################################
  248. # X Window System make variables; this need to be coordinated with rules
  249. # $XConsortium: Project.tmpl,v 1.63 89/12/18 16:46:44 jim Exp $
  250. X
  251. X          PATHSEP = /
  252. X        USRLIBDIR = $(DESTDIR)/usr/lib
  253. X           BINDIR = $(DESTDIR)/usr/bin/X11
  254. X          INCROOT = $(DESTDIR)/usr/include
  255. X     BUILDINCROOT = $(TOP)
  256. X      BUILDINCDIR = $(BUILDINCROOT)/X11
  257. X      BUILDINCTOP = ..
  258. X           INCDIR = $(INCROOT)/X11
  259. X           ADMDIR = $(DESTDIR)/usr/adm
  260. X           LIBDIR = $(USRLIBDIR)/X11
  261. X        CONFIGDIR = $(LIBDIR)/config
  262. X       LINTLIBDIR = $(USRLIBDIR)/lint
  263. X
  264. X          FONTDIR = $(LIBDIR)/fonts
  265. X         XINITDIR = $(LIBDIR)/xinit
  266. X           XDMDIR = $(LIBDIR)/xdm
  267. X           AWMDIR = $(LIBDIR)/awm
  268. X           TWMDIR = $(LIBDIR)/twm
  269. X           GWMDIR = $(LIBDIR)/gwm
  270. X          MANPATH = $(DESTDIR)/usr/man
  271. X    MANSOURCEPATH = $(MANPATH)/man
  272. X           MANDIR = $(MANSOURCEPATH)n
  273. X        LIBMANDIR = $(MANSOURCEPATH)3
  274. X      XAPPLOADDIR = $(LIBDIR)/app-defaults
  275. X
  276. X        SOXLIBREV = 4.2
  277. X          SOXTREV = 4.0
  278. X         SOXAWREV = 4.0
  279. X        SOOLDXREV = 4.0
  280. X         SOXMUREV = 4.0
  281. X        SOXEXTREV = 4.0
  282. X
  283. X       FONTCFLAGS = -t
  284. X
  285. X     INSTAPPFLAGS = $(INSTDATFLAGS)
  286. X
  287. X            IMAKE = $(IMAKESRC)/imake
  288. X           DEPEND = $(DEPENDSRC)/makedepend
  289. X              RGB = $(RGBSRC)/rgb
  290. X            FONTC = $(BDFTOSNFSRC)/bdftosnf
  291. X        MKFONTDIR = $(MKFONTDIRSRC)/mkfontdir
  292. X        MKDIRHIER = /bin/sh $(SCRIPTSRC)/mkdirhier.sh
  293. X
  294. X        CONFIGSRC = $(TOP)/config
  295. X        CLIENTSRC = $(TOP)/clients
  296. X          DEMOSRC = $(TOP)/demos
  297. X           LIBSRC = $(TOP)/lib
  298. X          FONTSRC = $(TOP)/fonts
  299. X       INCLUDESRC = $(TOP)/X11
  300. X        SERVERSRC = $(TOP)/server
  301. X          UTILSRC = $(TOP)/util
  302. X        SCRIPTSRC = $(UTILSRC)/scripts
  303. X       EXAMPLESRC = $(TOP)/examples
  304. X       CONTRIBSRC = $(TOP)/../contrib
  305. X           DOCSRC = $(TOP)/doc
  306. X           RGBSRC = $(TOP)/rgb
  307. X        DEPENDSRC = $(UTILSRC)/makedepend
  308. X         IMAKESRC = $(CONFIGSRC)
  309. X         XAUTHSRC = $(LIBSRC)/Xau
  310. X          XLIBSRC = $(LIBSRC)/X
  311. X           XMUSRC = $(LIBSRC)/Xmu
  312. X       TOOLKITSRC = $(LIBSRC)/Xt
  313. X       AWIDGETSRC = $(LIBSRC)/Xaw
  314. X       OLDXLIBSRC = $(LIBSRC)/oldX
  315. X      XDMCPLIBSRC = $(LIBSRC)/Xdmcp
  316. X      BDFTOSNFSRC = $(FONTSRC)/bdftosnf
  317. X     MKFONTDIRSRC = $(FONTSRC)/mkfontdir
  318. X     EXTENSIONSRC = $(TOP)/extensions
  319. X
  320. X  DEPEXTENSIONLIB = $(EXTENSIONSRC)/lib/libXext.a
  321. X     EXTENSIONLIB =   $(DEPEXTENSIONLIB)
  322. X
  323. X          DEPXLIB = $(DEPEXTENSIONLIB)
  324. X             XLIB = $(EXTENSIONLIB) -L$(XLIBSRC) -lX11
  325. X
  326. X      DEPXAUTHLIB = $(XAUTHSRC)/libXau.a
  327. X         XAUTHLIB =  $(DEPXAUTHLIB)
  328. X
  329. X        DEPXMULIB =
  330. X           XMULIB = -L$(XMUSRC) -lXmu
  331. X
  332. X       DEPOLDXLIB =
  333. X          OLDXLIB = -L$(OLDXLIBSRC) -loldX
  334. X
  335. X      DEPXTOOLLIB =
  336. X         XTOOLLIB = -L$(TOOLKITSRC) -lXt
  337. X
  338. X        DEPXAWLIB =
  339. X           XAWLIB = -L$(AWIDGETSRC) -lXaw
  340. X
  341. X LINTEXTENSIONLIB = $(EXTENSIONSRC)/lib/llib-lXext.ln
  342. X         LINTXLIB = $(XLIBSRC)/llib-lX11.ln
  343. X          LINTXMU = $(XMUSRC)/llib-lXmu.ln
  344. X        LINTXTOOL = $(TOOLKITSRC)/llib-lXt.ln
  345. X          LINTXAW = $(AWIDGETSRC)/llib-lXaw.ln
  346. X
  347. X          DEPLIBS = $(DEPXAWLIB) $(DEPXMULIB) $(DEPXTOOLLIB) $(DEPXLIB)
  348. X
  349. X         DEPLIBS1 = $(DEPLIBS)
  350. X         DEPLIBS2 = $(DEPLIBS)
  351. X         DEPLIBS3 = $(DEPLIBS)
  352. X
  353. X      USRINCDIR = $(DESTDIR)/usr/include
  354. X        TESTSRC = $(TOP)/tests
  355. X    MTOOLKITSRC = $(LIBSRC)/Xt
  356. X     MWIDGETSRC = $(LIBSRC)/Xm
  357. X   MRESOURCESRC = $(LIBSRC)/Mrm
  358. X         UILSRC = $(CLIENTSRC)/uil
  359. X            UIL = $(UILSRC)/uil
  360. X      XMTOOLLIB = $(MTOOLKITSRC)/libXt.a
  361. X          XMLIB = $(MWIDGETSRC)/libXm.a
  362. X   MRESOURCELIB = $(MRESOURCESRC)/libMrm.a
  363. X         UILLIB = $(UILSRC)/libUil.a
  364. X  LINTMRESOURCE = $(MRESOURCESRC)/libMrm.a
  365. LINTXMWIDGETLIB = $(MWIDGETSRC)/llib-l/Xm.ln
  366. X     LINTXMTOOL = $(MTOOLKITSRC)/llib-lXt.ln
  367. X     LINTUILLIB = $(UILSRC)/llib-lUil.ln
  368. X
  369. ###########################################################################
  370. # Imake rules for building libraries, programs, scripts, and data files
  371. # rules:  $XConsortium: Imake.rules,v 1.67 89/12/18 17:14:15 jim Exp $
  372. X
  373. ###########################################################################
  374. # start of Imakefile
  375. X
  376. ###############################################################
  377. # Imakefile for XFBROWS
  378. ###############################################################
  379. # Possible flags are : -DSVR4 -Di386 -DSCO
  380. #                and : -DNOTIMER -DUSLEEP (see Makefile.mk)
  381. ###############################################################
  382. X
  383. DEFINES = -DNOTIMER
  384. INCLUDES = -I$(TOP) -I$(TOP)/X11
  385. DEPLIBS = $(DEPXTOOLLIB) $(DEPXMULIB) $(DEPXLIB)
  386. LOCAL_LIBRARIES = $(XTOOLLIB) $(XMULIB) $(XLIB)
  387. X
  388. SRCS = butt.c dialog.c dir.c list.c misc.c scrl.c xfbrows.c
  389. OBJS = butt.o dialog.o dir.o list.o misc.o scrl.o xfbrows.o
  390. X
  391. X PROGRAM = xfbrows
  392. X
  393. all:: xfbrows
  394. X
  395. xfbrows: $(OBJS) $(DEPLIBS)
  396. X    $(RM) $@
  397. X    $(CC) -o $@ $(OBJS) $(LDOPTIONS) $(LOCAL_LIBRARIES) $(LDLIBS) $(EXTRA_LOAD_FLAGS)
  398. X
  399. saber_xfbrows:
  400. X    #load $(ALLDEFINES) $(SRCS) $(LOCAL_LIBRARIES) $(SYS_LIBRARIES) $(EXTRA_LIBRARIES)
  401. X
  402. osaber_xfbrows:
  403. X    #load $(ALLDEFINES) $(OBJS) $(LOCAL_LIBRARIES) $(SYS_LIBRARIES) $(EXTRA_LIBRARIES)
  404. X
  405. install:: xfbrows
  406. X    $(INSTALL) -c $(INSTPGMFLAGS)   xfbrows $(BINDIR)
  407. X
  408. install.man:: xfbrows.man
  409. X    $(INSTALL) -c $(INSTMANFLAGS) xfbrows.man $(MANDIR)/xfbrows.n
  410. X
  411. depend:: $(DEPEND)
  412. X
  413. $(DEPEND):
  414. X    @echo "checking $@ over in $(DEPENDSRC) first..."; \
  415. X    cd $(DEPENDSRC); $(MAKE); \
  416. X    echo "okay, continuing in $(CURRENT_DIR)"
  417. X
  418. depend::
  419. X    $(DEPEND) -s "# DO NOT DELETE" -- $(ALLDEFINES) -- $(SRCS)
  420. X
  421. lint:
  422. X    $(LINT) $(LINTFLAGS) $(SRCS) $(LINTLIBS)
  423. lint1:
  424. X    $(LINT) $(LINTFLAGS) $(FILE) $(LINTLIBS)
  425. X
  426. clean::
  427. X    $(RM) $(PROGRAM)
  428. X
  429. ###########################################################################
  430. # common rules for all Makefiles - do not edit
  431. X
  432. emptyrule::
  433. X
  434. clean::
  435. X    $(RM_CMD) \#*
  436. X
  437. Makefile:: $(IMAKE)
  438. X
  439. $(IMAKE):
  440. X    @(cd $(IMAKESRC); if [ -f Makefile ]; then \
  441. X    echo "checking $@ in $(IMAKESRC) first..."; $(MAKE) all; else \
  442. X    echo "bootstrapping $@ from Makefile.ini in $(IMAKESRC) first..."; \
  443. X    $(MAKE) -f Makefile.ini BOOTSTRAPCFLAGS=$(BOOTSTRAPCFLAGS); fi; \
  444. X    echo "okay, continuing in $(CURRENT_DIR)")
  445. X
  446. Makefile::
  447. X    -@if [ -f Makefile ]; then \
  448. X    echo "    $(RM) Makefile.bak; $(MV) Makefile Makefile.bak"; \
  449. X    $(RM) Makefile.bak; $(MV) Makefile Makefile.bak; \
  450. X    else exit 0; fi
  451. X    $(IMAKE_CMD) -DTOPDIR=$(TOP) -DCURDIR=$(CURRENT_DIR)
  452. X
  453. tags::
  454. X    $(TAGS) -w *.[ch]
  455. X    $(TAGS) -xw *.[ch] > TAGS
  456. X
  457. saber:
  458. X    #load $(ALLDEFINES) $(SRCS)
  459. X
  460. osaber:
  461. X    #load $(ALLDEFINES) $(OBJS)
  462. X
  463. ###########################################################################
  464. # empty rules for directories that do not have SUBDIRS - do not edit
  465. X
  466. install::
  467. X    @echo "install in $(CURRENT_DIR) done"
  468. X
  469. install.man::
  470. X    @echo "install.man in $(CURRENT_DIR) done"
  471. X
  472. Makefiles::
  473. X
  474. includes::
  475. X
  476. ###########################################################################
  477. # dependencies generated by makedepend
  478. X
  479. SHAR_EOF
  480. chmod 0644 Makefile ||
  481. echo 'restore of Makefile failed'
  482. Wc_c="`wc -c < 'Makefile'`"
  483. test 10759 -eq "$Wc_c" ||
  484.     echo 'Makefile: original size 10759, current size' "$Wc_c"
  485. fi
  486. # ============= Makefile.mk ==============
  487. if test -f 'Makefile.mk' -a X"$1" != X"-c"; then
  488.     echo 'x - skipping Makefile.mk (File already exists)'
  489. else
  490. echo 'x - extracting Makefile.mk (Text)'
  491. sed 's/^X//' << 'SHAR_EOF' > 'Makefile.mk' &&
  492. # Makefile for xfile
  493. ###############################################################
  494. X
  495. # your C compiler of choice
  496. CC = gcc
  497. LIBS = -lX11 -linet
  498. PRG = xfbrows
  499. X
  500. ###############################################################
  501. # Possible flags are : -DSVR4 -Di386 -DSCO
  502. #                and : -DNOTIMER -DUSLEEP
  503. ###############################################################
  504. X
  505. ###############################################################
  506. # For SYSV :
  507. FLAGS = -DSVR4 -DNOTIMER
  508. ###############################################################
  509. # For BSD :
  510. # FLAGS = -DNOTIMER
  511. ###############################################################
  512. # For A/UX :
  513. # FLAGS = -DNOTIMER
  514. ###############################################################
  515. # For SCO :
  516. # FLAGS = -DSCO -DNOTIMER
  517. ###############################################################
  518. X
  519. CFLAGS = -O $(FLAGS)
  520. OBJS = butt.o dialog.o dir.o list.o misc.o scrl.o xfbrows.o
  521. X
  522. .c.o:    ; $(CC) -c $(CFLAGS) $*.c -o $@
  523. X
  524. all: $(PRG)
  525. X
  526. xfbrows: $(OBJS)
  527. X    $(CC) $(CFLAGS) -o $(PRG) $(OBJS) $(LIBS)
  528. X    strip $(PRG)
  529. X
  530. $(OBJS):    xfbrows.h
  531. ctrl.o:        bitmaps.h
  532. scrl.o:        bitmaps.h
  533. butt.o:        bitmaps.h
  534. X
  535. SHAR_EOF
  536. chmod 0644 Makefile.mk ||
  537. echo 'restore of Makefile.mk failed'
  538. Wc_c="`wc -c < 'Makefile.mk'`"
  539. test 1120 -eq "$Wc_c" ||
  540.     echo 'Makefile.mk: original size 1120, current size' "$Wc_c"
  541. fi
  542. # ============= Imakefile ==============
  543. if test -f 'Imakefile' -a X"$1" != X"-c"; then
  544.     echo 'x - skipping Imakefile (File already exists)'
  545. else
  546. echo 'x - extracting Imakefile (Text)'
  547. sed 's/^X//' << 'SHAR_EOF' > 'Imakefile' &&
  548. #ifdef BandAidCompiler
  549. #include BandAidCompiler
  550. #endif
  551. X
  552. ###############################################################
  553. # Imakefile for XFBROWS
  554. ###############################################################
  555. # Possible flags are : -DSVR4 -Di386 -DSCO
  556. #                and : -DNOTIMER -DUSLEEP (see Makefile.mk)
  557. ###############################################################
  558. X
  559. DEFINES = -DNOTIMER
  560. INCLUDES = -I$(TOP) -I$(TOP)/X11
  561. DEPLIBS = $(DEPXTOOLLIB) $(DEPXMULIB) $(DEPXLIB)
  562. LOCAL_LIBRARIES = $(XTOOLLIB) $(XMULIB) $(XLIB)
  563. X
  564. SRCS = butt.c dialog.c dir.c list.c misc.c scrl.c xfbrows.c
  565. OBJS = butt.o dialog.o dir.o list.o misc.o scrl.o xfbrows.o
  566. X
  567. ComplexProgramTarget(xfbrows)
  568. X
  569. SHAR_EOF
  570. chmod 0600 Imakefile ||
  571. echo 'restore of Imakefile failed'
  572. Wc_c="`wc -c < 'Imakefile'`"
  573. test 679 -eq "$Wc_c" ||
  574.     echo 'Imakefile: original size 679, current size' "$Wc_c"
  575. fi
  576. # ============= XFBROWS.AD ==============
  577. if test -f 'XFBROWS.AD' -a X"$1" != X"-c"; then
  578.     echo 'x - skipping XFBROWS.AD (File already exists)'
  579. else
  580. echo 'x - extracting XFBROWS.AD (Text)'
  581. sed 's/^X//' << 'SHAR_EOF' > 'XFBROWS.AD' &&
  582. X
  583. xbrows*geometry:        -10-10
  584. xbrows*icongeom:        +700+10
  585. xbrows*foreground:        black
  586. xbrows*background:        white
  587. xbrows*borderwidth:        2
  588. xbrows*iconic:            false
  589. X
  590. SHAR_EOF
  591. chmod 0644 XFBROWS.AD ||
  592. echo 'restore of XFBROWS.AD failed'
  593. Wc_c="`wc -c < 'XFBROWS.AD'`"
  594. test 151 -eq "$Wc_c" ||
  595.     echo 'XFBROWS.AD: original size 151, current size' "$Wc_c"
  596. fi
  597. # ============= bitmaps.h ==============
  598. if test -f 'bitmaps.h' -a X"$1" != X"-c"; then
  599.     echo 'x - skipping bitmaps.h (File already exists)'
  600. else
  601. echo 'x - extracting bitmaps.h (Text)'
  602. sed 's/^X//' << 'SHAR_EOF' > 'bitmaps.h' &&
  603. X
  604. #define down_width 16
  605. #define down_height 16
  606. static char down_bits[] =
  607. {
  608. X   0xff, 0xff, 0x01, 0x80, 0x01, 0x80, 0xf1, 0x87, 0x11, 0x84, 0x11, 0x84,
  609. X   0x11, 0x84, 0x1f, 0xbc, 0x05, 0x90, 0x09, 0x88, 0x11, 0x84, 0x21, 0x82,
  610. X   0x41, 0x81, 0x81, 0x80, 0x01, 0x80, 0xff, 0xff
  611. };
  612. X
  613. #define down1_width 16
  614. #define down1_height 16
  615. static char down1_bits[] =
  616. {
  617. X   0xff, 0xff, 0x01, 0x80, 0x01, 0x80, 0xf1, 0x87, 0xf1, 0x87, 0xf1, 0x87,
  618. X   0xf1, 0x87, 0xff, 0xbf, 0xfd, 0x9f, 0xf9, 0x8f, 0xf1, 0x87, 0xe1, 0x83,
  619. X   0xc1, 0x81, 0x81, 0x80, 0x01, 0x80, 0xff, 0xff
  620. };
  621. X
  622. #define up_width 16
  623. #define up_height 16
  624. static char up_bits[] =
  625. {
  626. X   0xff, 0xff, 0x01, 0x80, 0x81, 0x80, 0x41, 0x81, 0x21, 0x82, 0x11, 0x84,
  627. X   0x09, 0x88, 0x05, 0x90, 0x1f, 0xbc, 0x11, 0x84, 0x11, 0x84, 0x11, 0x84,
  628. X   0xf1, 0x87, 0x01, 0x80, 0x01, 0x80, 0xff, 0xff
  629. };
  630. X
  631. #define up1_width 16
  632. #define up1_height 16
  633. static char up1_bits[] =
  634. {
  635. X   0xff, 0xff, 0x01, 0x80, 0x81, 0x80, 0xc1, 0x81, 0xe1, 0x83, 0xf1, 0x87,
  636. X   0xf9, 0x8f, 0xfd, 0x9f, 0xff, 0xbf, 0xf1, 0x87, 0xf1, 0x87, 0xf1, 0x87,
  637. X   0xf1, 0x87, 0x01, 0x80, 0x01, 0x80, 0xff, 0xff
  638. };
  639. X
  640. #define scrlgray_width 8
  641. #define scrlgray_height 8
  642. static char scrlgray_bits[] =
  643. {
  644. X   0x11, 0x44, 0x11, 0x44, 0x11, 0x44, 0x11, 0x44
  645. };
  646. X
  647. #define gray50_width 8
  648. #define gray50_height 8
  649. static char gray50_bits[] =
  650. {
  651. X   0x33, 0xcc, 0x33, 0xcc, 0x33, 0xcc, 0x33, 0xcc
  652. };
  653. X
  654. SHAR_EOF
  655. chmod 0644 bitmaps.h ||
  656. echo 'restore of bitmaps.h failed'
  657. Wc_c="`wc -c < 'bitmaps.h'`"
  658. test 1371 -eq "$Wc_c" ||
  659.     echo 'bitmaps.h: original size 1371, current size' "$Wc_c"
  660. fi
  661. # ============= xfbrows.h ==============
  662. if test -f 'xfbrows.h' -a X"$1" != X"-c"; then
  663.     echo 'x - skipping xfbrows.h (File already exists)'
  664. else
  665. echo 'x - extracting xfbrows.h (Text)'
  666. sed 's/^X//' << 'SHAR_EOF' > 'xfbrows.h' &&
  667. X
  668. #define REVDATE        "Rev: 01/07/91"
  669. X
  670. #include <stdio.h>
  671. #include <math.h>
  672. #include <ctype.h>
  673. #include <string.h>
  674. extern int   errno;
  675. extern char *sys_errlist[];
  676. X
  677. /* neither IBM AOS 4.3, Convex, nor BSD 4.3 on VAX have <malloc.h> */
  678. #if !defined(ibm032) && !defined(__convexc__) && \
  679. X    !(defined(vax) && !defined(ultrix))
  680. #if defined(hp300) || defined(hp800)
  681. #include <sys/malloc.h>
  682. #else
  683. #include <malloc.h>
  684. #endif
  685. #endif
  686. X
  687. #include <X11/Xos.h>
  688. #include <X11/Xlib.h>
  689. #include <X11/Xutil.h>
  690. #include <X11/cursorfont.h>
  691. #include <X11/keysym.h>
  692. X
  693. #if defined(NEEDSTIME) || defined(NEEDSDIR)
  694. #include <sys/types.h>
  695. #endif
  696. X
  697. #ifdef NEEDSTIME
  698. #include <sys/time.h>
  699. #include <signal.h>
  700. #if defined(SCO) && !defined(NOTIMER)
  701. #include <sys/itimer.h>
  702. #endif
  703. #ifndef  sigmask
  704. #define  sigmask(m)      (1 << ((m)-1))
  705. #endif
  706. #endif
  707. X
  708. #ifdef SVR4
  709. #define HOLD_SIG         sighold(SIGALRM)
  710. #define RELEASE_SIG      sigrelse(SIGALRM)
  711. #define PAUSE_SIG        sigpause(SIGALRM)
  712. #else
  713. #define HOLD_SIG         sigblock(sigmask(SIGALRM))
  714. #define RELEASE_SIG      sigblock(0)
  715. #define PAUSE_SIG        sigpause(0)
  716. #endif
  717. X
  718. #ifdef i386
  719. #undef  HOLD_SIG
  720. #define HOLD_SIG
  721. #undef  RELEASE_SIG
  722. #define RELEASE_SIG
  723. #undef  PAUSE_SIG
  724. #define PAUSE_SIG
  725. #endif
  726. X
  727. #ifndef MAXPATHLEN
  728. #define MAXPATHLEN    512
  729. #endif
  730. X
  731. #define PROGNAME    "xfbrows"
  732. #define DEFDIRGEOM    "-10-10"
  733. X
  734. #define DIRWIDE        600
  735. #define DIRHIGH        270
  736. X
  737. #define S_NBUTTS    2
  738. #define S_BOPTI        0
  739. #define S_BQUIT        1
  740. X
  741. #define S_SBUTTS    2
  742. #define S_SOK        0
  743. #define S_SCANCEL    1
  744. X
  745. #define C_FIFO        'f'
  746. #define C_CHR        'c'
  747. #define C_DIR        'd'
  748. #define C_BLK        'b'
  749. #define C_LNK        'l'
  750. #define C_SOCK        's'
  751. #define C_REG        ' '
  752. X
  753. #define NLINES 12
  754. #define BUTTW 60
  755. #define BUTTH 19
  756. X
  757. #define SPACING 3
  758. #define ASCENT   (cfinfo->ascent)
  759. #define DESCENT  (cfinfo->descent)
  760. #define CHIGH    (ASCENT + DESCENT)
  761. #define LINEHIGH (CHIGH + SPACING)
  762. X
  763. #define STDINSTR "<stdin>"
  764. X
  765. #ifndef MAIN
  766. #define WHERE extern
  767. #else
  768. #define WHERE
  769. #endif
  770. X
  771. typedef struct
  772. {
  773. X    Window win;
  774. X    int len;
  775. X    int vert;
  776. X    int active;
  777. X    int min, max;
  778. X    int val;
  779. X    int page;
  780. X    int tpos;
  781. X    int tmin, tmax;
  782. X    int tsize;
  783. X    unsigned long fg, bg;
  784. X    void (*drawobj)();
  785. X    int uplit, dnlit;
  786. } SCRL;
  787. X
  788. typedef struct
  789. {
  790. X    Window win;
  791. X    int x, y, w, h;
  792. X    int lit;
  793. X    int active;
  794. X    int toggle;
  795. X    unsigned long fg, bg;
  796. X    char *str;
  797. } BUTT;
  798. X
  799. typedef struct
  800. {
  801. X    Window win;
  802. X    int x, y, w, h;
  803. X    unsigned long fg, bg;
  804. X    char **str;
  805. X    int nstr;
  806. X    int selected;
  807. X    int nlines;
  808. X    SCRL scrl;
  809. X    int filetypes;
  810. X    int dirsonly;
  811. } LIST;
  812. X
  813. #define CENTERX(f,x,str) ((x)-XTextWidth(f,str,strlen(str))/2)
  814. #define CENTERY(f,y) ((y)-((f->ascent+f->descent)/2)+f->ascent)
  815. #define RANGE(a,b,c) { if (a<b) a=b;  if (a>c) a=c; }
  816. #define PTINRECT(x,y,rx,ry,rw,rh) \
  817. X           ((x)>=(rx) && (y)>=(ry) && (x)<=(rx)+(rw) && (y)<=(ry)+(rh))
  818. X
  819. WHERE Display        *theDisp;
  820. WHERE int            theScreen;
  821. WHERE unsigned int    ncells, dispWIDE, dispHIGH, dispDEEP;
  822. WHERE Colormap        theCmap;
  823. WHERE Window        rootW;
  824. WHERE GC            theGC;
  825. WHERE unsigned long    black, white, fg, bg, infofg, infobg;
  826. WHERE Font            mfont, bfont, disfont;
  827. WHERE XFontStruct    *mfinfo, *bfinfo, *cfinfo, *disfinfo;
  828. WHERE Visual        *theVisual;
  829. WHERE Cursor        arrow, target, hand;
  830. X
  831. WHERE char            *cmd;
  832. WHERE int            mono;
  833. X
  834. WHERE int            ncols;
  835. WHERE int            bwidth;
  836. X
  837. WHERE int            numnames, curname;
  838. WHERE Pixmap        grayTile, grayStip;
  839. X
  840. WHERE Window        dirW, dnamW;
  841. WHERE LIST            dList;
  842. WHERE BUTT            dbut[S_NBUTTS], sbut[S_SBUTTS];
  843. WHERE char            **dirnames;
  844. X
  845. WHERE Window        diaW, disW;
  846. X
  847. WHERE int            iconic;
  848. WHERE char            *icongeom;
  849. X
  850. #undef WHERE
  851. X
  852. Window CreateWindow();
  853. int StringWidth();
  854. void SetBold (), SetNormal (), ExposureWin (), Timer(), FatalError(), Quit();
  855. X
  856. void LSCreate(), LSRedraw(), LSNewData();
  857. int  LSClick();
  858. X
  859. void CreateDirW(), RedrawDirW(), LoadCurrentDirectory();
  860. int ClickDirW(), DirKey();
  861. void DoDisplay ();
  862. void RedrawDDirW(), RedrawDNamW(), SelectDir(), TrackDDirW();
  863. void SetDirFName(), SetTypeName();
  864. X
  865. void SCCreate(), SCSetRange(), SCSetVal(), SCRedraw(), SCTrack();
  866. X
  867. void BTCreate(), BTSetActive(), BTRedraw(); int  BTTrack();
  868. X
  869. void CreateDisW (), RedrawDisW (); int DisplayEventLoop ();
  870. void CreateErrW (), RedrawErrW (); int ErrorEventLoop ();
  871. X
  872. void SetFonts ();
  873. X
  874. SHAR_EOF
  875. chmod 0644 xfbrows.h ||
  876. echo 'restore of xfbrows.h failed'
  877. Wc_c="`wc -c < 'xfbrows.h'`"
  878. test 4110 -eq "$Wc_c" ||
  879.     echo 'xfbrows.h: original size 4110, current size' "$Wc_c"
  880. fi
  881. # ============= xfbrows.man ==============
  882. if test -f 'xfbrows.man' -a X"$1" != X"-c"; then
  883.     echo 'x - skipping xfbrows.man (File already exists)'
  884. else
  885. echo 'x - extracting xfbrows.man (Text)'
  886. sed 's/^X//' << 'SHAR_EOF' > 'xfbrows.man' &&
  887. .TH XFBROWS 1 "1 July 1991" "X Version 11"
  888. .SH NAME
  889. xfbrows - X11 font browser
  890. .SH SYNOPSIS
  891. .B xfbrows
  892. .B [
  893. [-display disp] [-iconic]
  894. .br
  895. X        [-geometry geom] [-icongeom geom]
  896. .br
  897. X        [-bg background] [-fg foreground] [-bw width]
  898. .B ]
  899. .SH DESCRIPTION
  900. .I Xfbrows
  901. is a simple font browser for X11.
  902. .PP
  903. When the window opens, it will display all fonts the server knows
  904. in a scrollable list.
  905. X
  906. Simply click a fontname (or type one in, with wildcard too) and a window will
  907. come up showing you the font. Click the OK-Button to leave this window.
  908. X
  909. Click the QUIT-Button to leave the application.
  910. .SH OPTIONS
  911. .I Xfbrows
  912. accepts all X Toolkit command line options listed below:
  913. .PP
  914. .TP 12
  915. .B -display
  916. Sets the display to the specified name (Resource name: display, Type: string,
  917. Default: none).
  918. .TP 12
  919. .B -geometry
  920. Specifies the
  921. .I xfbrows
  922. position on the screen. You can't resize the window
  923. (Resource name: geometry, Type: string, Default: none).
  924. .TP 12
  925. .B -icongeom
  926. Specifies the
  927. .I xfbrows
  928. icon position on the screen. Only positive values are excepted, because
  929. the size of the icon depends on the window manager
  930. (Resource name: icongeom, Type: string, Default: none).
  931. .TP 12
  932. .B -fg
  933. Sets the foreground color for the windows (Resource name: foreground,
  934. Type: color, Default: black).
  935. .TP 12
  936. .B -bg
  937. Sets the background color for the windows (Resource name: background,
  938. Type: color, Default: white).
  939. .TP 12
  940. .B -bw
  941. Specifies the border width for the windows (Resource name: borderwidth,
  942. Type: digit, Default: 2).
  943. .TP 12
  944. .B -iconic
  945. Specifies that
  946. .I xfbrows
  947. should start up iconified (Resource name: iconic, Type: boolean,
  948. Default: false).
  949. .SH DIAGNOSTICS
  950. .I Xfbrows
  951. exits with EOF (-1) if a fatal error occurs, otherwise with zero (0).
  952. If an error occurs during an action, a error window is coming up explaining
  953. the error. Click the OK-Button to continue (selected or specified fontnames
  954. are then deselected).
  955. .SH AUTHOR
  956. .I Phade Software
  957. .br
  958. Inh. Frank Gadegast
  959. .br
  960. Schierker Str. 39
  961. .br
  962. 1000 Berlin 44 GERMANY
  963. .PP
  964. Copyright (c) 1991, Phade Software
  965. .PP
  966. phade@cs.tu-berlin.de
  967. .SH BUGS
  968. The thumb maybe doesn't works right with colors.
  969. SHAR_EOF
  970. chmod 0644 xfbrows.man ||
  971. echo 'restore of xfbrows.man failed'
  972. Wc_c="`wc -c < 'xfbrows.man'`"
  973. test 2132 -eq "$Wc_c" ||
  974.     echo 'xfbrows.man: original size 2132, current size' "$Wc_c"
  975. fi
  976. exit 0
  977.  
  978. --
  979. Dan Heller
  980. O'Reilly && Associates       Z-Code Software    Comp-sources-x:
  981. Senior Writer                President          comp-sources-x@uunet.uu.net
  982. argv@ora.com                 argv@zipcode.com
  983.